#! /usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Created by jianbing on 2017-09-08
"""

op_bar_chart = {
    "title": {
        "text": '测试标题'
    },
    "tooltip": {
        "trigger": 'axis',
        "axisPointer": {
            "type": 'shadow'
        }
    },
    "legend": {
        "data": ['']
    },
    "grid": {
        "left": '3%',
        "right": '4%',
        "bottom": '3%',
        "containLabel": True
    },
    "toolbox": {
        "feature": {
            "dataView": {"show": True, "readOnly": False},
            "restore": {"show": True},
            "saveAsImage": {"show": True},
        }
    },
    "xAxis": {
        "type": 'category',
        "data": ["默认数据1", "默认数据2"]
    },
    "yAxis": {
        "type": 'value'
    },
    "series": [
        {
            "name": 'bug数量',
            "type": 'bar',
            "data": ["111", "222"],
            "label": {
                "normal": {
                    "show": True,
                    "position": 'inside'
                }
            }
        }
    ]
}

op_line_chart = {
    "title": {
        "text": '测试标题'
    },
    "tooltip": {
        "trigger": 'axis'
    },
    "legend": {
        "data": ['']
    },
    "grid": {
        "left": '3%',
        "right": '4%',
        "bottom": '3%',
        "containLabel": True
    },
    "toolbox": {
        "feature": {
            "dataView": {"show": True, "readOnly": False},
            "restore": {"show": True},
            "saveAsImage": {"show": True},
        }
    },
    "xAxis": {
        "type": 'category',
        "boundaryGap": False,
        "data": ["默认数据1", "默认数据2"]
    },
    "yAxis": {
        "type": 'value'
    },
    "series": [
        {
            "name": '数量',
            "type": 'line',
            "stack": '总量',
            "label": {
                "normal": {
                    "show": True,
                    "position": 'top'
                }
            },
            "data": ["1", "2"]
        }
    ]
}

op_pie_chart = {
    "title": {
        "text": '某站点用户访问来源',
        "subtext": '',
        "x": 'center'
    },
    "tooltip": {
        "trigger": 'item',
        "formatter": "{a} <br/>{b} : {c} ({d}%)"
    },
    "toolbox": {
        "feature": {
            "dataView": {"show": True, "readOnly": False},
            "restore": {"show": True},
            "saveAsImage": {"show": True},
        }
    },
    "legend": {
        "orient": 'vertical',
        "left": 'left',
        "data": ['直接访问', '邮件营销', '联盟广告', '视频广告', '搜索引擎']
    },
    "series": [
        {
            "name": '访问来源',
            "type": 'pie',
            "radius": '65%',
            "center": ['50%', '50%'],
            "data": [
                {"value": 335, "name": '直接访问'},
                {"value": 310, "name": '邮件营销'},
                {"value": 234, "name": '联盟广告'},
                {"value": 135, "name": '视频广告'},
                {"value": 1548, "name": '搜索引擎'}
            ],
            "itemStyle": {
                "emphasis": {
                    "shadowBlur": 10,
                    "shadowOffsetX": 0,
                    "shadowColor": 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
}
